package com.sinoglobal.networkconnections;

import android.content.Context;

import com.orhanobut.logger.Logger;
import com.zhy.http.okhttp.callback.StringCallback;

import okhttp3.Call;

/**
 * Created by XINDZ on 2017/2/7.
 * 功能:自定义CallBacck
 */

public class ResultCallback extends StringCallback {
    private Context context;

    public ResultCallback(Context context) {
        this.context = context;

    }

    @Override
    public void onError(Call call, Exception e, int id) {
        Logger.e("onError:" + e.toString());
        onErrorCode(e);
    }

    @Override
    public void onResponse(String response, int id) {
        Logger.e(response);
        Logger.json(response);
        onSuccess(response);

    }

    public void onSuccess(String response) {

    }

    public void onErrorCode(Exception e) {

    }
}
